package com.fwtai.web;

import com.fwtai.bean.PageFormData;
import com.fwtai.datasource.DaoHandle;
import org.springframework.stereotype.Repository;

import java.util.HashMap;
import java.util.List;

/**
 * 门店管理访问数据库
 * @作者 田应平
 * @版本 v1.0
 * @创建时间 2023-09-20 17:10:29
 * @QQ号码 444141300
 * @Email service@fwtai.com
 * @官网 <url>http://www.fwtai.com</url>
*/
@Repository
public class StoreAreaDao{

  private final DaoHandle dao;

  public StoreAreaDao(final DaoHandle dao){
    this.dao = dao;
  }

  public int updateCode(final PageFormData formData){
    return dao.execute("storeArea.updateCode",formData);
  }

  public List<HashMap<String,Object>> getListData(final PageFormData formData){
    return dao.queryForListHashMap("storeArea.listData",formData);
  }

  public Integer getListTotal(final PageFormData formData){
    return dao.queryForInteger("storeArea.listTotal",formData);
  }

  public List<HashMap<String,Object>> listAreaUsers(final String word){
    return dao.queryForListHashMap("storeArea.listAreaUsers",word);
  }

  public String getUserCode(final Long user_id){
    return dao.queryForString("storeArea.getUserCode",user_id);
  }
}